import glob
import os
import time
import db_2_json
import VadAnalyse

#s = stage2_analy.stage2_analy()
#print s
#s.parse_run("/home/levi/memory-images-analyzer_old/dumpfile/")

#dir_path = "/home/levi/IsMatch/dumpfile/image/"
#map_path = "/home/levi/IsMatch/dumpfile/processmap/"
#file_name = glob.glob(dir_path+"*.json")
#file_name.sort()


def db_to_json(db_path):
	op = db_2_json.db_2_json()
#	db_path = "/home/levi/IsMatch/dumpfile/original/"
	json_path = "/home/levi/memory-images-analyzer/codes/d3_tree/skip/details/dumpfile/json/"
	dbfile = glob.glob(db_path+"*.db")
	i = 0
	for db_path in dbfile:
		op.connection(db_path,json_path+"connection_{}.json".format(i))
		i += 1
 
def vadinfo():
	image_addr = "/home/levi/memory-images-analyzer_old/codes/MyModule/vadanalyse/image0.dump"
	info_addr = "/home/levi/memory-images-analyzer_old/codes/MyModule/vadanalyse/"
	pe_path = "/home/levi/memory-images-analyzer_old/codes/MyModule/vadanalyse/lsass.exe.103aa10.0x77bb0000-0x77bc4fff.dmp"
	json_path = "/home/levi/memory-images-analyzer_old/codes/MyModule/vadanalyse/peinfo.json"
	info = VadAnalyse.VadAnalyse()
	info.GetVadinfo(image_addr,info_addr)
	info.VadDump(image_addr,info_addr)
	info.ParsePE(pe_path,json_path)
if __name__ == "__main__":
	print "start"
	db_to_json("/home/levi/memory-images-analyzer/codes/d3_tree/skip/details/dumpfile/database/")

